Typesetting #tex2html_accent_inline2811# Objects

Typing the name of an occasional <#1334#>APL<#1334#> symbol within a normal text is not a real nuisance to the author of <#1335#>APL<#1335#> texts. But typesetting a larger piece of <#1336#>APL<#1336#> code certainly is. Imagine a function named <#405#><#405#>, which implements a recursive tree traversal algorithm:


#APLfns407#

In order to print just the beginning of the header of the function, you would have to type:

verbatim124#

Obtaining the familiar function layout used in <#1337#>APL<#1337#> textbooks would require additional code. What is more, besides being awkward the whole process is error-prone: Almost certainly it will result in a printout different from the <#1338#>APL<#1338#> code.

Therefore we strongly recommend automatic translation of <#1339#>APL<#1339#> code. We provide an <#1340#>APL<#1340#> front end which transforms <#1341#>APL<#1341#> objects into logical document elements which can be 121 into LATEX documents. This guarantees consonance between the original <#1342#>APL<#1342#> code and its listing and is also more convenient.

For all <#1343#>APL<#1343#> language elements we have defined <#1344#>APL<#1344#> functions and corresponding LATEX environments. Our system supports the typesetting of:

Apart from minor modifications we have used traditional layout conventions for all language elements. For example, the convention that user input is six spaces indented can be traced back to the very first implementation of <#1348#>APL<#1348#>. An other traditional convention states that if a line of <#1349#>APL<#1349#> code does not fit on a single line of the display, the rest of the code is wrapped around and continues on the next line. In some functions this rule may lead to line breaks in the middle of names. Since <#1350#>APL<#1350#> identifiers can be up to 255 characters long line breaking within names cannot be avoided in general.

As you can see, arrays and functions can be typeset in various ways. For example, the above listing of the <#1351#>APL<#1351#> function was printed by the following <#1352#>APL<#1352#> expression:

<#835#>26
#APLbold455#
<#835#> 28

The <#1353#>APL<#1353#> function produces the file <#459#>tree.tex<#459#> as output. The <#1354#>APL<#1354#> front end not only maps each character into the corresponding TEX macro but it also produces the line numbers in brackets and the surrounding LATEX environments in order to guarantee uniform display of functions throughout the document.

In the following we present examples for each of the cases mentioned above. At the same time, the examples give us the opportunity to demonstrate variations of type style and size.